<template>
  <div class="setting-wrap">
    <van-nav-bar title="账号设置" left-arrow @click-left="onClickLeft" />
    <div class="logout" @click="logoutHandle">退出登录</div>
  </div>
</template>

<script>
import { Dialog } from "vant";
import { Notify } from "vant";
export default {
  methods: {
    onClickLeft() {
      this.$router.push("/redwine/user");
    },
    logoutHandle() {
      Dialog.confirm({
        message: "确认退出登录吗"
      })
        .then(() => {
          Notify({ type: "success", message: "退出成功" });
          localStorage.clear();
          this.$router.push("/redwine/home");
        })
        .catch(() => {});
    }
  }
};
</script>

<style lang="stylus" scoped>
.logout {
  height: 0.44rem;
  background-color: #c3a769;
  text-align: center;
  line-height: 0.44rem;
  color: #fff;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.van-nav-bar >>> .van-icon {
  color: #0f0f0f !important;
}

.setting-wrap {
  height: 100%;
  position: relative;
}
</style>